<template>
    <div class="ec-app-container">
        <!-- 查询条件 -->
        <div class="filter-container">
            <el-form label-width="90px">
                <el-row :gutter="10">
                    <el-col :span="6">
                        <el-form-item label="楼盘名称：" >
                            <el-input v-model="listQuery.buildingName" placeholder="楼盘名称"/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="姓名：" >
                            <el-input v-model="listQuery.name" placeholder="姓名"/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6">
                        <el-form-item label="手机号：" >
                            <el-input v-model="listQuery.phone" placeholder="手机号"/>
                        </el-form-item>
                    </el-col>
                    <el-col :span="6" class="text-center">
                        <el-button type="primary" class="border-4C7FD7 color-4C7FD7" icon="el-icon-search" @click="searchList">查询</el-button>
                        <el-button class="border-4C7FD7 color-4C7FD7" @click="resetSearch">重置</el-button>
                    </el-col>
                </el-row>
            </el-form>
        </div>
        <!-- table -->
        <div>
            <div class="mt-30">
                <el-button class="filter-item" type="primary" @click="addBuilding">导出</el-button>
            </div>
            <div class="mt-20">
                <el-table
                        v-loading="listLoading"
                        :data="list"
                        border
                        fit
                        highlight-current-row
                        @selection-change="handleSelectionChange"
                        style="width: 100%;">
                    <el-table-column
                            type="selection"
                            width="55"/>
                    <el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width">
                        <template slot-scope="scope">
                            <el-button type="primary" size="mini" @click="handleUpdate(scope.row)">查看</el-button>
                        </template>
                    </el-table-column>
                    <el-table-column label="楼盘名称" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.object.buildingName }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="姓名" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.object.name }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="手机号" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.object.phone }}</span>
                        </template>
                    </el-table-column>
                    <el-table-column label="预约时间" prop="id" align="center">
                        <template slot-scope="scope">
                            <span>{{ scope.row.object.appointmentTime }}</span>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
            <pagination v-show="total>0" :total="total" :page.sync="listQuery.pageNum" :limit.sync="listQuery.pageSize" @pagination="searchList" />
        </div>
    </div>
</template>

<script>
    import Pagination from '@/components/Pagination' // Secondary package based on el-pagination、
    export default {
        name: 'Project',
        components: {
            Pagination
        },
        data() {
            return {
                listQuery: {
                    level: 'appointment',
                    buildingName: '',
                    phone: '',
                    name: '',
                    pageSize: 10,
                    pageNum: 1
                }
            }
        },
        created() {
            // 初始化
            this.searchList()
        }
    }
</script>

<style scoped>

</style>